n = int(input("请输入一个整数："))

def getYinZi(num):
    res = []
    for i in range(1,num):
        if num%i==0:
            res.append(i)
    return res

he = 0
for i in range(1,n+1):

    list = getYinZi(i)
    he = sum(list)
    if he==i:
        print(i,list)